<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>create (Spec::DSL::BehaviourFactory)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File vendor\plugins\rspec/lib/spec/dsl/behaviour_factory.rb, line 25</span>
        <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
          <span class="ruby-identifier">opts</span> = <span class="ruby-constant">Hash</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">last</span> <span class="ruby-value">? </span><span class="ruby-identifier">args</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">:</span> {}
          <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:shared</span>]
            <span class="ruby-identifier">behaviour_type</span> = <span class="ruby-identifier">:default</span>
          <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:behaviour_type</span>]
            <span class="ruby-identifier">behaviour_type</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:behaviour_type</span>]
          <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:spec_path</span>] <span class="ruby-operator">=~</span> <span class="ruby-node">/spec(\\|\/)(#{BEHAVIOUR_CLASSES.keys.join('|')})/</span>
            <span class="ruby-identifier">behaviour_type</span> = <span class="ruby-identifier">$2</span>.<span class="ruby-identifier">to_sym</span>
          <span class="ruby-keyword kw">else</span>
            <span class="ruby-identifier">behaviour_type</span> = <span class="ruby-identifier">:default</span>
          <span class="ruby-keyword kw">end</span>
          <span class="ruby-keyword kw">return</span> <span class="ruby-constant">BEHAVIOUR_CLASSES</span>[<span class="ruby-identifier">behaviour_type</span>].<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
        <span class="ruby-keyword kw">end</span></pre>
</body>
</html>